package com.ropeok.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Objects;

public class UserAndRole {

    @NotNull(message = "请输入用户id")
    private Integer user_id;
    @NotBlank(message = "请输入角色id")
    private Integer role_id;


    @Override
    public String toString() {
        return "UserAndRole{" +
                "user_id=" + user_id +
                ", role_id=" + role_id +
                '}';
    }

    @Override
    public boolean equals(Object obj) {
        if(this==obj){
            return true;
        }
        if (obj==null||getClass()!=obj.getClass()){
            return false;
        }
        UserAndRole userAndRole=(UserAndRole)obj;
        return Objects.equals(user_id,userAndRole.user_id)&&Objects.equals(role_id,userAndRole.role_id);
    }

    public Integer getUser_id() {
        return user_id;
    }

    public void setUser_id(Integer user_id) {
        this.user_id = user_id;
    }

    public Integer getRole_id() {
        return role_id;
    }

    public void setRole_id(Integer role_id) {
        this.role_id = role_id;
    }
}
